package org.surelink.radius;


import java.util.HashMap;
import java.util.Map;

public class RadiusConfig
{
    private Map options = new HashMap();

    public Map getOptions()
    {
        return options;
    }

    public RadiusConfig(Map options)
    {
        this.options = options;
    }

    public void setOptions(Map options)
    {
        this.options = options;
    }

    public void setOption(String key,String value){
          options.put(key,value);
    }

    public void setOption(String key,int value){
        options.put(key,value);
    }


    public String getString(String key){
          return (String) options.get(key);
    }

    public String getString(String key,String defaultVal){
        String result = (String) options.get(key);
        return result != null ? result : defaultVal;
    }

    public int getInt(String key){
        return Integer.valueOf((String)options.get(key));
    }

    public int getInt(String key,int defaultval){
        String  result =  (String)options.get(key);
        return result != null ? Integer.valueOf(result) : defaultval;
    }
}
